#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    ui->comboBox_2->addItem("薯条");
    ui->comboBox_2->addItem("鸡翅");

    ui->comboBox_3->addItem("可乐");
    ui->comboBox_3->addItem("雪碧");

    std::ifstream file("D:\\QtProjectRepositories\\learn_qt\\ComboBox\\config.txt");
    std::string tmp;
    while(std::getline(file,tmp))
    {
        ui->comboBox_4->addItem(QString::fromStdString(tmp));
    }
    file.close();
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    qDebug()<<ui->comboBox->currentText()<<" "<<ui->comboBox_2->currentText()<<" "<<ui->comboBox_3->currentText();
}

